package com.hsc.yalebao.tabMine;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.google.gson.Gson;
import com.hsc.yalebao.base.ActivityStack;
import com.hsc.yalebao.base.BaseActivity;
import com.hsc.yalebao.base.CustomApplication;
import com.hsc.yalebao.base.MainActivity;
import com.hsc.yalebao.base.MainWebActivity;
import com.hsc.yalebao.http.AppConstants;
import com.hsc.yalebao.http.RequestNet;
import com.hsc.yalebao.model.GetUserCountBean;
import com.hsc.yalebao.model.UserBaseBean;
import com.hsc.yalebao.tools.UiUtil;
import com.hsc.yalebao.weight.LogUtils;
import com.zhy.http.okhttp.callback.StringCallback;
import java.util.HashMap;
import okhttp3.Call;

public class DaiLiHoutaiActivity extends BaseActivity
{
  private static Context context;
  private String TAG = "DaiLiHoutaiActivity";
  private ImageView iv_title_right;
  private LinearLayout ll_daili_xieyi;
  private LinearLayout ll_look_down_daili;
  private LinearLayout ll_look_down_user;
  private LinearLayout ll_syfx;
  private int memberid;
  View.OnClickListener onClickListener = new View.OnClickListener()
  {
    public void onClick(View paramAnonymousView)
    {
      switch (paramAnonymousView.getId())
      {
      case 2131099704:
      default:
        return;
      case 2131099699:
        CustomApplication.app.finishActivity(DaiLiHoutaiActivity.this);
        return;
      case 2131099831:
        DaiLiHoutaiActivity.this.startActivity(new Intent(DaiLiHoutaiActivity.this, ShouYiFenXiActivity.class));
        return;
      case 2131099833:
        DaiLiHoutaiActivity.this.startActivity(new Intent(DaiLiHoutaiActivity.this, LookDownDailiActivity.class));
        return;
      case 2131099832:
        DaiLiHoutaiActivity.this.startActivity(new Intent(DaiLiHoutaiActivity.this, LookDownUserActivity.class));
        return;
      case 2131099834:
      }
      Intent localIntent = new Intent();
      localIntent.setClass(DaiLiHoutaiActivity.context, MainWebActivity.class);
      localIntent.putExtra("url", AppConstants.BASE_URL_IMG + "/wap/agree.aspx");
      localIntent.putExtra("title", "代理协议");
      DaiLiHoutaiActivity.this.startActivity(localIntent);
    }
  };
  private TextView tv_today_add;
  private TextView tv_vip_count;

  private void GetUserCount()
  {
    this.tv_today_add.setText("获取中...");
    this.tv_vip_count.setText("获取中...");
    if (CustomApplication.app.userBaseBean != null)
      this.memberid = CustomApplication.app.userBaseBean.getMemberid();
    HashMap localHashMap = new HashMap();
    localHashMap.put("memberid", this.memberid);
    LogUtils.d(this.TAG, "URL:" + AppConstants.URL_GET_GETUSERCOUNT);
    showLoadingDialog();
    RequestNet.get(context, AppConstants.URL_GET_GETUSERCOUNT, localHashMap, new StringCallback()
    {
      public void onError(Call paramAnonymousCall, Exception paramAnonymousException)
      {
        DaiLiHoutaiActivity.this.dismissLoadingDialog();
        LogUtils.e(DaiLiHoutaiActivity.this.TAG, "获取失败,获取代理的总会员数 和当日会员你数:" + paramAnonymousException);
      }

      public void onResponse(String paramAnonymousString)
      {
        DaiLiHoutaiActivity.this.dismissLoadingDialog();
        LogUtils.d(DaiLiHoutaiActivity.this.TAG, "result:" + paramAnonymousString);
        if (UiUtil.IsValueEmpty(paramAnonymousString))
          LogUtils.d(DaiLiHoutaiActivity.this.TAG, "result:" + paramAnonymousString);
        GetUserCountBean localGetUserCountBean;
        do
        {
          return;
          Gson localGson = new Gson();
          try
          {
            localGetUserCountBean = (GetUserCountBean)localGson.fromJson(paramAnonymousString, GetUserCountBean.class);
            if (localGetUserCountBean == null)
            {
              LogUtils.e(DaiLiHoutaiActivity.this.TAG, "getUserCountBean == null");
              return;
            }
          }
          catch (Exception localException1)
          {
            while (true)
            {
              localException1.printStackTrace();
              localGetUserCountBean = null;
            }
            if (localGetUserCountBean.getFlag() == 0)
            {
              LogUtils.e(DaiLiHoutaiActivity.this.TAG, "getUserCountBean.getFlag() ==0");
              return;
            }
            if (localGetUserCountBean.getFlag() == -2)
            {
              DaiLiHoutaiActivity.this.showDownWireDialog();
              return;
            }
            if (localGetUserCountBean.getFlag() == -3)
            {
              DaiLiHoutaiActivity.this.ShowFengjinDialog();
              return;
            }
            if (localGetUserCountBean.getFlag() == -4)
            {
              DaiLiHoutaiActivity.activityStack.backToMain(MainActivity.class, DaiLiHoutaiActivity.context);
              return;
            }
          }
        }
        while (localGetUserCountBean.getFlag() != 1);
        try
        {
          int i = localGetUserCountBean.getTodaycount();
          int j = localGetUserCountBean.getTotalcount();
          DaiLiHoutaiActivity.this.tv_today_add.setText(i);
          DaiLiHoutaiActivity.this.tv_vip_count.setText(j);
          LogUtils.d(DaiLiHoutaiActivity.this.TAG, "todaycount:" + i);
          LogUtils.d(DaiLiHoutaiActivity.this.TAG, "totalcount:" + j);
          return;
        }
        catch (Exception localException2)
        {
          localException2.printStackTrace();
        }
      }
    });
  }

  private void init()
  {
    this.tv_today_add = ((TextView)findViewById(2131099830));
    this.tv_vip_count = ((TextView)findViewById(2131099829));
    this.ll_syfx = ((LinearLayout)findViewById(2131099831));
    this.ll_look_down_daili = ((LinearLayout)findViewById(2131099833));
    this.ll_look_down_user = ((LinearLayout)findViewById(2131099832));
    this.ll_daili_xieyi = ((LinearLayout)findViewById(2131099834));
    this.ll_syfx.setOnClickListener(this.onClickListener);
    this.ll_look_down_daili.setOnClickListener(this.onClickListener);
    this.ll_look_down_user.setOnClickListener(this.onClickListener);
    this.ll_daili_xieyi.setOnClickListener(this.onClickListener);
  }

  @TargetApi(19)
  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903054);
    context = this;
    setTitle(8, 0, 2130837809, "代理后台", 0, 8, 8, 0, true);
    init();
    GetUserCount();
  }

  @SuppressLint({"NewApi"})
  public void setTitle(int paramInt1, int paramInt2, int paramInt3, String paramString, int paramInt4, int paramInt5, int paramInt6, int paramInt7, boolean paramBoolean)
  {
    View localView = findViewById(2131099716);
    if (paramBoolean)
      localView.setVisibility(0);
    while (true)
    {
      ((TextView)localView.findViewById(2131099701)).setText(paramString);
      ((TextView)localView.findViewById(2131099700)).setVisibility(paramInt1);
      ImageView localImageView = (ImageView)localView.findViewById(2131099699);
      localImageView.setVisibility(paramInt2);
      localImageView.setOnClickListener(this.onClickListener);
      localImageView.setImageResource(paramInt3);
      TextView localTextView = (TextView)localView.findViewById(2131099702);
      localTextView.setVisibility(paramInt5);
      localTextView.setOnClickListener(this.onClickListener);
      this.iv_title_right = ((ImageView)localView.findViewById(2131099704));
      this.iv_title_right.setVisibility(paramInt6);
      this.iv_title_right.setOnClickListener(this.onClickListener);
      this.iv_title_right.setImageResource(paramInt7);
      return;
      localView.setVisibility(8);
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.hsc.yalebao.tabMine.DaiLiHoutaiActivity
 * JD-Core Version:    0.6.2
 */